package com.example.demo.service;

import com.example.demo.entity.User;
import com.example.demo.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {

    @Autowired
    private UserMapper userMapper;

    public int reg(User user) {
        return userMapper.reg(user);
    }

    public User getUserByPhone(String phone) {
        return userMapper.getUserByPhone(phone);
    }

    public User getById(Integer userId) {
        return userMapper.getById(userId);
    }

    public int update(User user) {
        return userMapper.update(user);
    }
}
